﻿using LinFu.IoC.Interceptors;
using LinFu.IoC.Configuration;
using LinFu.IoC.Interfaces;

namespace CoreEx.Database.Client.Implementation
{
    public abstract class BaseInterceptor<T> : BaseInterceptor,IInitialize
    {
        protected T ActualTarget { get; set; }
        protected IServiceContainer ServiceContainer { get; private set; }
            

        protected BaseInterceptor(T actualTarget)
        {
            ActualTarget = actualTarget;
        }

        protected override object GetTarget(LinFu.AOP.Interfaces.IInvocationInfo info)
        {
            return ActualTarget;
        }
        


        public void Initialize(IServiceContainer source)
        {
            ServiceContainer = source;
        }
    }
}
